package cn.mw.cmdb.monitorview.entity;

import cn.mw.cmdb.entity.InstanceInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @description 刀片数据实体
 */
@Getter
@Setter
@Schema(name = "MwBladeDto", description = "刀片数据实体")
public class MwBladeDto {

    @Schema(description = "实例名称")
    private String instanceName;

    @Schema(description = "IP地址")
    private String inBandIp;

    @Schema(description = "实例ID")
    private String instanceId;

    @Schema(description = "主机ID")
    private String hostId;

    @Schema(description = "服务器ID")
    private Integer serverId;

    @Schema(description = "CPU")
    private String cpu;

    @Schema(description = "内存总数")
    private Integer memoryTotal;

    @Schema(description = "内存正常数")
    private Integer memoryNormalNumber;

    @Schema(description = "内存异常数")
    private Integer memoryAbNormalNumber;

    @Schema(description = "磁盘总数")
    private Integer diskTotal;

    @Schema(description = "磁盘正常数")
    private Integer diskNormalNumber;

    @Schema(description = "磁盘异常数")
    private Integer diskAbNormalNumber;

    @Schema(description = "风扇总数")
    private Integer fanTotal;

    @Schema(description = "风扇正常数")
    private Integer fanNormalNumber;

    @Schema(description = "风扇异常数")
    private Integer fanAbNormalNumber;

    @Schema(description = "电源总数")
    private Integer powerSupplyTotal;

    @Schema(description = "电源正常数")
    private Integer powerSupplyNormalNumber;

    @Schema(description = "电源异常数")
    private Integer powerSupplyAbNormalNumber;

    @Schema(description = "温度总数")
    private Integer temperatureTotal;

    @Schema(description = "温度正常数")
    private Integer temperatureNormalNumber;

    @Schema(description = "温度异常数")
    private Integer temperatureAbNormalNumber;

    @Schema(description = "阵列卡")
    private List<String> arrayCard;



    public void extractFrom(InstanceInfo instanceInfo){
        this.instanceName = instanceInfo.getInstanceName();
        this.inBandIp = instanceInfo.getInBandIp();
        this.instanceId = instanceInfo.getId();
        this.hostId = instanceInfo.getMonitorTypeId();
        this.serverId = instanceInfo.getMonitorServerId();
    }
}
